package serviceImpl;

        import dao.UserDAO;
        import entity.User;
        import serviceInterface.registerInterface;

/**
 * Create By Gn on 2021/6/9
 * 用途：注册功能业务逻辑
 **/
public class register implements registerInterface {

    public int register(String account,String password) {
        User user=new User();
        double id = 10000 + Math.random() * 1000;
        user.setId((int) id);
        user.setAccount(account);
        user.setPassword(password);
        int t = UserDAO.insert(user);
        System.out.println("新增了：" + t +"名用户！");
        return t;
    }
}
